class CompEvaluationsController < ApplicationController

  load_and_authorize_resource

  # GET /comp_evaluations
  # GET /comp_evaluations.xml
  def index
    @comp_evaluation = CompEvaluation.all

    respond_to do |format|
      format.html # index.html.erb
      format.xml  { render :xml => @comp_evaluation }
    end
  end

  # GET /comp_evaluations/1
  # GET /comp_evaluations/1.xml
  def show
    @comp_evaluation = CompEvaluation.find(params[:id])

    respond_to do |format|
      format.html # show.html.erb
      format.xml  { render :xml => @comp_evaluation }
    end
  end

  # GET /comp_evaluations/new
  # GET /comp_evaluations/new.xml
  def new
    @comp_evaluation = CompEvaluation.new

    respond_to do |format|
      format.html # new.html.erb
      format.xml  { render :xml => @comp_evaluation }
    end
  end

  # GET /comp_evaluations/1/edit
  def edit
    @comp_evaluation = CompEvaluation.find(params[:id])
  end

  # POST /comp_evaluations
  # POST /comp_evaluations.xml
  def create
    @comp_evaluation = CompEvaluation.new(params[:comp_evaluation])

    respond_to do |format|
      if @comp_evaluation.save
        format.html { redirect_to(@comp_evaluation, :notice => 'Comp evaluation was successfully created.') }
        format.xml  { render :xml => @comp_evaluation, :status => :created, :location => @comp_evaluation }
      else
        format.html { render :action => "new" }
        format.xml  { render :xml => @comp_evaluation.errors, :status => :unprocessable_entity }
      end
    end
  end

  # PUT /comp_evaluations/1
  # PUT /comp_evaluations/1.xml
  def update
    @comp_evaluation = CompEvaluation.find(params[:id])

    respond_to do |format|
      if @comp_evaluation.update_attributes(params[:comp_evaluation])
        format.html { redirect_to(@comp_evaluation, :notice => 'Comp evaluation was successfully updated.') }
        format.xml  { head :ok }
      else
        format.html { render :action => "edit" }
        format.xml  { render :xml => @comp_evaluation.errors, :status => :unprocessable_entity }
      end
    end
  end

  # DELETE /comp_evaluations/1
  # DELETE /comp_evaluations/1.xml
  def destroy
    @comp_evaluation = CompEvaluation.find(params[:id])
    @comp_evaluation.destroy

    respond_to do |format|
      format.html { redirect_to(comp_evaluations_url) }
      format.xml  { head :ok }
    end
  end
end
